/********************************************************************************
 *      Copyright:  (C) 2025 LingYun<iot25@lingyun>
 *                  All rights reserved.
 *
 *       Filename:  pack_data.h
 *    Description:  This file 
 *
 *        Version:  1.0.0(12/04/25)
 *         Author:  LingYun <iot25@lingyun>
 *      ChangeLog:  1, Release initial version on "12/04/25 14:29:03"
 *                 
 ********************************************************************************/
#ifndef __PACK_DATA_H__
#define __PACK_DATA_H__

#include<stdint.h>
#define	TLV_HEADER		0xFEED 

typedef struct pack_t
{
	char 			dev_id[32];
	float			temperature;
	char			dev_time[32];
} pack_t;

int pack_data(pack_t *pack, char *data, int bytes);

enum
{
	TAG_ID = 1,
	TAG_TEMPERATURE,
	TAG_TIME,
};

int pack_tlv(pack_t *pack, uint8_t *tlv_data, int bytes);
int pack_data_json(pack_t *pack, char *data, int bytes);

#endif

